<template>
  <div id="tuijianList" ref="tuijianList">
    <ul class="listWrap">
      <li v-show="contentData.length > 0" v-for="(item, index) in contentData" @click.stop.prevent="handle11(item)" :key="index">
        <p class="p1">
          <span style="float: left">{{ item.SBZT }}</span>
          <span style="float: right">{{ item.HOUSEAPPLICANT }}</span>
        </p>
        <p class="p3">
          <span style="float: left">理由：{{ item.OPINION }}</span>
          <span style="float: right">{{ item.APPLYTIME }}</span>
        </p>
        <p class="p3">
          <span style="float: left">地址：{{ item.CONSTRUCITONADDRESS ? item.CONSTRUCITONADDRESS : '暂无数据' }}</span>
        </p>
      </li>
      <div style="height: 60vh;text-align:center;padding-top: 20vh;" v-show="contentData.length == 0">
        <div style="margin-bottom: 10px;">
          <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png">
        </div>
        <div>暂无数据</div>
      </div>
    </ul>
  </div>
</template>
<script>
import { QuerySignCallback } from "../../utils/api";
import BScroll from 'better-scroll'
export default {
  data() {
    return {
      contentData: []
    }
  },
  methods: {
    getdata: async function () {
      let params2 = {
        "accessCode": "688bd3883572440a859dfd8ba9194e7b",
        "cityCode": window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
        "params": {
          dataguid: "76c1e60c-130b-4e62-bcf7-e4d524f16a72",
          // { "field": "applyphone", "value": window.localStorage.getItem('DanDianPhone') },
          searchObject: JSON.stringify([{ "field": "applyphone", "value": window.localStorage.getItem('DanDianPhone'),"link":"OR" },{ "field": "DBRSJH", "value": window.localStorage.getItem('DanDianPhone'),"link":"OR" }]),
          token: window.localStorage.getItem("token"),
        }
      }
      var res1 = await QuerySignCallback(params2);
      this.contentData = eval("(" + res1.data.data + ")").Data;
      this.$store.commit('getContent', this.contentData)
      this.$nextTick(() => {
        this.scroll = new BScroll(this.$refs.tuijianList, {
          click: false
        })
      })
    },
    handle11(data) {
      debugger
      //需要跳转到ApplicationPage页面中重新填写信息
      this.$confirm({
        title: '退件操作人:'+data.SIGNERNAME,
        message: data.OPINION,
         
      })
        .then(() => {
          // do something
          this.$router.push(
            {
              path: '/houseBuilding',
              query: {
                data:JSON.stringify(this.contentData[0])
              }
            }
          )
        })
        .catch(() => {
          console.log('no')
        })
    }
  },
  mounted() {
    if (this.$store.state.dataContent.length == 0) {
      this.getdata();
    } else {
      this.contentData = this.$store.state.dataContent
    }
    if (ZWJSBridge) {
      ZWJSBridge.setTitle({
        title: "退件记录",
      })
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    }
  }
}
</script>
<style lang='scss' scoped>
#tuijianList {
  height: 100%;
  overflow: auto;
}
</style>
  